﻿package isoengine.gameplay.ai {	import isoengine.events.*;	import isoengine.gameplay.ai.AI;	public class State {		public var stateName:String;		public var behaviors:Array;		public var currentBehaviorStep:Number;		public var myAI:AI;		public function State() {		}		public function getStateName():String {			return (stateName);		}		public function setAI(myAI:AI):void {			this.myAI = myAI;		}		public function processEvent(newEvent:String, success:Boolean):void {			switch (newEvent) {				case "control_complete":					if (success) {						myAI.getCurrentBehavior().stepBehavior(myAI, currentBehaviorStep);					} else {						myAI.getCurrentBehavior().breakBehavior(myAI, currentBehaviorStep);					}					break;			}		}		public function getBehavior():Behavior {			return (Behavior(behaviors[0]));		}		public function setCurrentBehaviorStep(step:Number):void {			currentBehaviorStep = step;		}	}}